<template>
  <div>
    <div class="picker-item">
      <CloudDatePicker v-model="time1" placeholder="Select Time" @change="onChange" @ok="onOk">
        <span>{{ time1 ? time1 : "SelectTime" }}</span>
      </CloudDatePicker>
    </div>
    <div class="picker-item">
      <CloudRangePicker v-model="time2">
        <span>
          {{ time2 ? time2 : "请选择" }}
        </span>
      </CloudRangePicker>
    </div>
  </div>
</template>

<script>
  import moment from 'moment';
  export default {
    title: '13.自定义渲染 ',
    subTitle: '增加自定义渲染功能，在默认 slot 中，你可以设置任何你想渲染的组件。',
    data () {
      return {
        time1: undefined,
        time2: undefined,
      }
    },
    methods: {
      onChange (value, dateString) {
        console.log('Selected Time: ', value);
        console.log('Formatted Selected Time: ', dateString);
      },
      onOk (value) {
        console.log('onOk: ', value);
      },
      clearTime () {
        this.time1 = undefined;
      },
    }
  }
</script>

<style lang="scss">
</style>